﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace FileTransferProtocol
{
    [Serializable]
    public class FileBlock
    {
        public string Guid
        {
            get;
            set;
        }
        [NonSerialized]
        public FileStream FStream;
        public long ConnectionID
        {
            get;
            set;
        }
        public string FileName
        {
            get;
            set;
        }
        /// <summary>
        /// 块ID
        /// </summary>
        public string BlockId
        {
            get;
            set;
        }
        /// <summary>
        /// 块总大小
        /// </summary>
        public long TotalSize
        {
            get;
            set;
        }
        /// <summary>
        /// 块在文件中的开始位置
        /// </summary>
        public long BeginPos
        {
            get;
            set;
        }
        /// <summary>
        /// 块在文件中的结束位置
        /// </summary>
        public long EndPos
        {
            get;
            set;
        }
        /// <summary>
        /// 已经传输的数量
        /// </summary>
        public long HasTransfer
        {
            get;
            set;
        }
        public bool Complated
        {
            get;
            set;
        }
        /// <summary>
        /// 分块的临时文件
        /// </summary>
        public string TempFile
        {
            get;
            set;
        }
        /// <summary>
        /// 当次传输的数据
        /// </summary>
        public byte[] Data
        {
            get;
            set;
        }
        public int CurrentSize
        {
            get;
            set;
        }
        public bool StartProcess
        {
            get;
            set;
        }
    }
}
